import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Main from '../views/catalog/Main.vue'
import Category from '../views/catalog/Category.vue'
import Product from '../views/catalog/Product.vue'
import Item from '../views/catalog/Item.vue'
import Signon from '../views/account/Signon.vue'
import EditAccount from '../views/account/EditAccount.vue'
import Book from '../views/Book.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/Main',
    component: Main
  },
  {
    path: '/catalog/category',
    component: Category
  },
  {
    path: '/catalog/product',
    component: Product
  },
  {
    path: '/catalog/item',
    component: Item
  },
  {
    path: '/account/signon',
    component: Signon
  },
  {
    path: '/account/editAccount',
    component: EditAccount
  },
  {
    path: '/book',
    component: Book
  }
]

const router = new VueRouter({
  // History 模式
  mode: 'history',
  routes
})

export default router
